Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(esx_mechanicjob): rework and rewrite by Tizas #25

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from

Conversation

Arctos2win
Copy link
Contributor

No description provided.

client/main.lua Outdated
cb(vehicle)
end)

Citizen.CreateThread(function()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove Citizen. you can just trigger CreateThread no need for Citizen in front of it.

client/main.lua Outdated
local playerPed = ESX.PlayerData.ped
local playerCoords = GetEntityCoords(playerPed)
local vehicle = ESX.Game.GetClosestVehicle(playerCoords)
if vehicle == -1 then cb(false) end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not vehicle or vehicle == -1 then
return cb(false) -- return otherwise it will trigger cb(vehicle) as well
end

cb(vehicle)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Arctos2win ESX.Game.GetClosestVehicle will either return -1 or an entity handle. No need to check for nil

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Arctos2win ESX.Game.GetClosestVehicle will either return -1 or an entity handle. No need to check for nil

didnt know the point was just the return before cb(false) otherwise cb(true) will also run even if there is no vehicle

)
end

Citizen.CreateThread(function()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Citizen. can be removed

end

local function EndJob()
if activeJob then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not activeJob then
return ESX.ShowNotification(TranslateCap('no_active_job'))
end

client/modules/npcJob.lua Outdated Show resolved Hide resolved
server/modules/stashes.lua Outdated Show resolved Hide resolved
server/modules/tyreKit.lua Outdated Show resolved Hide resolved
client/modules/npcJob.lua Outdated Show resolved Hide resolved
end

local function MonitorRepair()
Citizen.CreateThread(function()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove Citizen.

return EndJob()
end
print("Player Entered Zone")
SpawnVehicle(job.vehicleCoords, job.carModel)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spawn server side vehicle and add an extra step on server to check timing

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brb, ill go bash my head into a wall

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

textui still not handled correctly

@Capy1174
Copy link

is there anyway if i can edit this code ? and make a pr overit?

@Tiziukas
Copy link

@Capy1174 Once it is finished and merged, feel free to PR anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 To be Discussed
Development

Successfully merging this pull request may close these issues.

4 participants